-- 创建表空间
create tablespace testDB
datafile 'D:\app\Administrator\oradata\orcl\testdb.dbf'
size 100m;

-- 创建用户
create user testdb indentified by testdb default tablespace testDB;

-- 赋予相应权限
grant connect to testdb;
grant resource to testdb;

-- 使用新用户登录
connect testdb/testdb;

create table users(
	id number(10) primary key,
	name varchar2(50) not null,
	password varchar2(50) not null,
	sex char(1) default '1', -- '1'是男，'0'是女
	reg_date date
);
create sequence users_id minvalue 0 increment by 1 start with 1;

insert into users(id,name,password,sex) values (users_id.nextval,'admin','123','1');
commit;